package com.xishu.entity.plat;

import com.xishu.annotation.dao.FieldMapping;
import com.xishu.annotation.valid.UniqueName;
import com.xishu.entity.AbstractEntity;
import com.xishu.entity.shop.ItemDetail;
import com.xishu.entity.shop.PriceConfig;
import com.xishu.entity.shop.Scene;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.List;

/**
 * 向导的配置
 */
@Entity(name = "guide_config")
@Table(indexes = {@Index(columnList = "userId")})
public class GuideConfig extends AbstractEntity {
    @ApiModelProperty(value = "用户id,一个用户只能有一个向导")
    @UniqueName
    private Long userId;

    @ApiModelProperty(value = "销售模式，1：茶餐廳/冰室/粉麵店 2：快餐 3：酒樓，日料，扒房等全服務式餐廳 4：街頭小食 5：其他")
    private Integer saleType;

    @ApiModelProperty(value = "分店名称")
    private String shopName;

    @ApiModelProperty(value = "地址")
    @Transient
    @FieldMapping(desField = "addressListJson", serialize = true)
    private List<String> addressList;

    @ApiModelProperty(value = "地址")
    @FieldMapping(desField = "addressList", serialize = false, genericType = "java.lang.String")
    private String addressListJson;

    @ApiModelProperty(value = "详情地址")
    private String shopDetailAddress;

    @ApiModelProperty(value = "餐廳電話")
    private String phone;

    @ApiModelProperty(value = "是否选择了场景")
    private Boolean selectScene;

    @ApiModelProperty(value = "场景列表")
    @Transient
    @FieldMapping(desField = "sceneEntityListJson", serialize = true)
    private transient List<Scene> sceneEntityList;

    @ApiModelProperty(value = "场景列表")
    @FieldMapping(desField = "sceneEntityList", serialize = false, genericType = "com.xishu.entity.shop.Scene")
    @Lob
    @Column(columnDefinition = "MEDIUMTEXT")
    private String sceneEntityListJson;

    @ApiModelProperty(value = "餐厅经理账号选择, 1,2,3")
    private Integer managerOptionSelect;

    @ApiModelProperty(value = "二级密码")
    private String secondaryPassword;

    @ApiModelProperty(value = "如果不是将自己的账号设置成分店经理，那么需要邀请他人的邮件地址")
    private String inviteEmail;

    @ApiModelProperty(value = "品类的名称")
    private String catalogName;

    @ApiModelProperty(value = "品类对应的场景列表")
    @Transient
    @FieldMapping(desField = "catalogSceneListJson", serialize = true)
    private List<String> catalogSceneList;

    @ApiModelProperty(value = "品类对应的场景列表")
    @FieldMapping(desField = "catalogSceneList", serialize = false, genericType = "java.lang.String")
    private String catalogSceneListJson;

    @ApiModelProperty(value = "菜品的名称")
    private String itemName;

    @ApiModelProperty(value = "菜品对应的场景列表")
    @Transient
    @FieldMapping(desField = "itemSceneListJson", serialize = true)
    private List<String> itemSceneList;

    @ApiModelProperty(value = "菜品对应的场景列表")
    @FieldMapping(desField = "itemSceneList", serialize = false, genericType = "java.lang.String")
    private String itemSceneListJson;

    @ApiModelProperty(value = "发送厨房别名")
    private String printAlias;

    @FieldMapping(desField = "priceConfigJson", serialize = true)
    @Transient
    private List<PriceConfig> priceConfigList;

    @FieldMapping(desField = "priceConfigList", serialize = false, genericType = "com.xishu.entity.shop.PriceConfig")
    @Column(length = 1024)
    private String priceConfigJson;

    @Transient
    @FieldMapping(desField = "itemDetailJson", serialize = true)
    @ApiModelProperty(value = "菜品细节，也是菜品规格")
    private List<ItemDetail> itemDetailList;

    @FieldMapping(desField = "itemDetailList", serialize = false, genericType = "com.xishu.entity.shop.ItemDetail")
    @ApiModelProperty(value = "菜品细节，也是菜品规格")
    @Column(length = 2048)
    private String itemDetailJson;

    @ApiModelProperty(value = "是否提供外卖")
    private Boolean takeout;

    @ApiModelProperty(value = "1餐桌點單，2桌面二維碼點單，3服務員出單二維碼點單，4總二維碼（外賣）")
    @Transient
    @FieldMapping(desField = "qrCodeListJson", serialize = true)
    private List<Integer> qrCodeList;

    @ApiModelProperty(value = "1餐桌點單 2對應快餐點單 3桌面二維碼點單 4服務員出單二維碼點單 5總二維碼（堂食）6總二維碼（外賣）")
    @FieldMapping(desField = "qrCodeList", serialize = false, genericType = "java.lang.Integer")
    private String qrCodeListJson;

    @ApiModelProperty(value = "是否允许拼桌")
    private Boolean allowAddTable;

    @ApiModelProperty(value = "服务费的比例,输入整数")
    private Double serviceFeePercent;

    @ApiModelProperty(value = "外卖打折比例,直接输入XX折，比如7.5折")
    private Double takeoutFeePercent;

    @ApiModelProperty(value = "是否需要打印机")
    private Boolean needPrinter;

    @ApiModelProperty(value = "厨房打印机的数量")
    private Integer kitchenPrinterNumber;

    @ApiModelProperty(value = "吧台打印机的数量，也就是小票打印机的数量")
    private Integer barCounterPrinterNumber;

    @ApiModelProperty(value = "是否已经提交")
    private Boolean submit;

    @ApiModelProperty(value = "当前第几页")
    private Integer currentPageNumber;

    @ApiModelProperty(value = "跳过了哪些页")
    @Transient
    @FieldMapping(desField = "skipNumberListJson", serialize = true)
    private List<Integer> skipNumberList;

    @FieldMapping(desField = "skipNumberList", serialize = false, genericType = "java.lang.Integer")
    @ApiModelProperty(value = "跳过了哪些页")
    private String skipNumberListJson;

    @ApiModelProperty(value = "汇总的图片id")
    private String guideResultImage;

    @ApiModelProperty(value = "向导里面的索引")
    @Transient
    @FieldMapping(desField = "sceneIndexJson", serialize = true)
    private List<Integer> sceneIndex;

    @ApiModelProperty(value = "向导里面的索引")
    @FieldMapping(desField = "sceneIndex", serialize = false, genericType = "java.lang.Integer")
    private String sceneIndexJson;

    @ApiModelProperty(value = "美国版本地址")
    private String usAddress;

    @ApiModelProperty(value = "美国版本城市")
    private String usCity;

    @ApiModelProperty(value = "美国版邮编")
    private String usZip;

    @ApiModelProperty(value = "美国版本州")
    private String usState;

    public String getUsAddress() {
        return usAddress;
    }

    public void setUsAddress(String usAddress) {
        this.usAddress = usAddress;
    }

    public String getUsCity() {
        return usCity;
    }

    public void setUsCity(String usCity) {
        this.usCity = usCity;
    }

    public String getUsZip() {
        return usZip;
    }

    public void setUsZip(String usZip) {
        this.usZip = usZip;
    }

    public String getUsState() {
        return usState;
    }

    public void setUsState(String usState) {
        this.usState = usState;
    }

    public String getGuideResultImage() {
        return guideResultImage;
    }

    public void setGuideResultImage(String guideResultImage) {
        this.guideResultImage = guideResultImage;
    }

    public Boolean getSubmit() {
        return submit;
    }

    public void setSubmit(Boolean submit) {
        this.submit = submit;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getSaleType() {
        return saleType;
    }

    public void setSaleType(Integer saleType) {
        this.saleType = saleType;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Boolean getSelectScene() {
        return selectScene;
    }

    public void setSelectScene(Boolean selectScene) {
        this.selectScene = selectScene;
    }

    public String getInviteEmail() {
        return inviteEmail;
    }

    public void setInviteEmail(String inviteEmail) {
        this.inviteEmail = inviteEmail;
    }

    public String getCatalogName() {
        return catalogName;
    }

    public void setCatalogName(String catalogName) {
        this.catalogName = catalogName;
    }

    public List<String> getCatalogSceneList() {
        return catalogSceneList;
    }

    public void setCatalogSceneList(List<String> catalogSceneList) {
        this.catalogSceneList = catalogSceneList;
    }

    public String getCatalogSceneListJson() {
        return catalogSceneListJson;
    }

    public void setCatalogSceneListJson(String catalogSceneListJson) {
        this.catalogSceneListJson = catalogSceneListJson;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getPrintAlias() {
        return printAlias;
    }

    public void setPrintAlias(String printAlias) {
        this.printAlias = printAlias;
    }

    public List<PriceConfig> getPriceConfigList() {
        return priceConfigList;
    }

    public void setPriceConfigList(List<PriceConfig> priceConfigList) {
        this.priceConfigList = priceConfigList;
    }

    public String getPriceConfigJson() {
        return priceConfigJson;
    }

    public void setPriceConfigJson(String priceConfigJson) {
        this.priceConfigJson = priceConfigJson;
    }

    public List<ItemDetail> getItemDetailList() {
        return itemDetailList;
    }

    public void setItemDetailList(List<ItemDetail> itemDetailList) {
        this.itemDetailList = itemDetailList;
    }

    public String getItemDetailJson() {
        return itemDetailJson;
    }

    public void setItemDetailJson(String itemDetailJson) {
        this.itemDetailJson = itemDetailJson;
    }

    public Boolean getTakeout() {
        return takeout;
    }

    public void setTakeout(Boolean takeout) {
        this.takeout = takeout;
    }

    public List<Integer> getQrCodeList() {
        return qrCodeList;
    }

    public void setQrCodeList(List<Integer> qrCodeList) {
        this.qrCodeList = qrCodeList;
    }

    public String getQrCodeListJson() {
        return qrCodeListJson;
    }

    public void setQrCodeListJson(String qrCodeListJson) {
        this.qrCodeListJson = qrCodeListJson;
    }

    public Boolean getAllowAddTable() {
        return allowAddTable;
    }

    public void setAllowAddTable(Boolean allowAddTable) {
        this.allowAddTable = allowAddTable;
    }

    public Double getTakeoutFeePercent() {
        return takeoutFeePercent;
    }

    public void setTakeoutFeePercent(Double takeoutFeePercent) {
        this.takeoutFeePercent = takeoutFeePercent;
    }

    public Boolean getNeedPrinter() {
        return needPrinter;
    }

    public void setNeedPrinter(Boolean needPrinter) {
        this.needPrinter = needPrinter;
    }

    public Integer getKitchenPrinterNumber() {
        return kitchenPrinterNumber;
    }

    public void setKitchenPrinterNumber(Integer kitchenPrinterNumber) {
        this.kitchenPrinterNumber = kitchenPrinterNumber;
    }

    public Integer getBarCounterPrinterNumber() {
        return barCounterPrinterNumber;
    }

    public void setBarCounterPrinterNumber(Integer barCounterPrinterNumber) {
        this.barCounterPrinterNumber = barCounterPrinterNumber;
    }

    public Integer getCurrentPageNumber() {
        return currentPageNumber;
    }

    public void setCurrentPageNumber(Integer currentPageNumber) {
        this.currentPageNumber = currentPageNumber;
    }

    public List<Integer> getSkipNumberList() {
        return skipNumberList;
    }

    public void setSkipNumberList(List<Integer> skipNumberList) {
        this.skipNumberList = skipNumberList;
    }

    public String getSkipNumberListJson() {
        return skipNumberListJson;
    }

    public void setSkipNumberListJson(String skipNumberListJson) {
        this.skipNumberListJson = skipNumberListJson;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public List<String> getAddressList() {
        return addressList;
    }

    public void setAddressList(List<String> addressList) {
        this.addressList = addressList;
    }

    public String getAddressListJson() {
        return addressListJson;
    }

    public void setAddressListJson(String addressListJson) {
        this.addressListJson = addressListJson;
    }

    public String getShopDetailAddress() {
        return shopDetailAddress;
    }

    public void setShopDetailAddress(String shopDetailAddress) {
        this.shopDetailAddress = shopDetailAddress;
    }

    public List<Scene> getSceneEntityList() {
        return sceneEntityList;
    }

    public void setSceneEntityList(List<Scene> sceneEntityList) {
        this.sceneEntityList = sceneEntityList;
    }

    public String getSceneEntityListJson() {
        return sceneEntityListJson;
    }

    public void setSceneEntityListJson(String sceneEntityListJson) {
        this.sceneEntityListJson = sceneEntityListJson;
    }

    public Double getServiceFeePercent() {
        return serviceFeePercent;
    }

    public void setServiceFeePercent(Double serviceFeePercent) {
        this.serviceFeePercent = serviceFeePercent;
    }

    public List<Integer> getSceneIndex() {
        return sceneIndex;
    }

    public void setSceneIndex(List<Integer> sceneIndex) {
        this.sceneIndex = sceneIndex;
    }

    public String getSceneIndexJson() {
        return sceneIndexJson;
    }

    public void setSceneIndexJson(String sceneIndexJson) {
        this.sceneIndexJson = sceneIndexJson;
    }

    public Integer getManagerOptionSelect() {
        return managerOptionSelect;
    }

    public void setManagerOptionSelect(Integer managerOptionSelect) {
        this.managerOptionSelect = managerOptionSelect;
    }

    public List<String> getItemSceneList() {
        return itemSceneList;
    }

    public void setItemSceneList(List<String> itemSceneList) {
        this.itemSceneList = itemSceneList;
    }

    public String getItemSceneListJson() {
        return itemSceneListJson;
    }

    public void setItemSceneListJson(String itemSceneListJson) {
        this.itemSceneListJson = itemSceneListJson;
    }

    public String getSecondaryPassword() {
        return secondaryPassword;
    }

    public void setSecondaryPassword(String secondaryPassword) {
        this.secondaryPassword = secondaryPassword;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("GuideConfig{");
        sb.append("userId=").append(userId);
        sb.append(", saleType=").append(saleType);
        sb.append(", shopName='").append(shopName).append('\'');
        sb.append(", addressList=").append(addressList);
        sb.append(", addressListJson='").append(addressListJson).append('\'');
        sb.append(", shopDetailAddress='").append(shopDetailAddress).append('\'');
        sb.append(", phone='").append(phone).append('\'');
        sb.append(", selectScene=").append(selectScene);
        sb.append(", sceneEntityList=").append(sceneEntityList);
        sb.append(", sceneEntityListJson='").append(sceneEntityListJson).append('\'');
        sb.append(", managerOptionSelect=").append(managerOptionSelect);
        sb.append(", secondaryPassword='").append(secondaryPassword).append('\'');
        sb.append(", inviteEmail='").append(inviteEmail).append('\'');
        sb.append(", catalogName='").append(catalogName).append('\'');
        sb.append(", catalogSceneList=").append(catalogSceneList);
        sb.append(", catalogSceneListJson='").append(catalogSceneListJson).append('\'');
        sb.append(", itemName='").append(itemName).append('\'');
        sb.append(", itemSceneList=").append(itemSceneList);
        sb.append(", itemSceneListJson='").append(itemSceneListJson).append('\'');
        sb.append(", printAlias='").append(printAlias).append('\'');
        sb.append(", priceConfigList=").append(priceConfigList);
        sb.append(", priceConfigJson='").append(priceConfigJson).append('\'');
        sb.append(", itemDetailList=").append(itemDetailList);
        sb.append(", itemDetailJson='").append(itemDetailJson).append('\'');
        sb.append(", takeout=").append(takeout);
        sb.append(", qrCodeList=").append(qrCodeList);
        sb.append(", qrCodeListJson='").append(qrCodeListJson).append('\'');
        sb.append(", allowAddTable=").append(allowAddTable);
        sb.append(", serviceFeePercent=").append(serviceFeePercent);
        sb.append(", takeoutFeePercent=").append(takeoutFeePercent);
        sb.append(", needPrinter=").append(needPrinter);
        sb.append(", kitchenPrinterNumber=").append(kitchenPrinterNumber);
        sb.append(", barCounterPrinterNumber=").append(barCounterPrinterNumber);
        sb.append(", submit=").append(submit);
        sb.append(", currentPageNumber=").append(currentPageNumber);
        sb.append(", skipNumberList=").append(skipNumberList);
        sb.append(", skipNumberListJson='").append(skipNumberListJson).append('\'');
        sb.append(", guideResultImage='").append(guideResultImage).append('\'');
        sb.append(", sceneIndex=").append(sceneIndex);
        sb.append(", sceneIndexJson='").append(sceneIndexJson).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
